package com.iss.apartmentmanage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iss.apartmentmanage.entity.Permission;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface PermissionMapper extends BaseMapper<Permission> {
    @Select("select id,per_name,per_code from user inner join user_role on user_id=id" +
            "inner join role_permission on user_role.role_id= role_permission.per_id" +
            "inner join permission on permission.id=role_permission.per_id" +
            "where user.id=#{id}")
    List<Permission> selectPermissionByUserId(Integer id);
}
